using IcsSEMCtrl.Util;
using System;
namespace IcsSEMCtrl.Global.Device
{
	public class CarrierState
	{
		public const int _NONE = 0;
		public const int _WAITIN = 1;
		public const int _TRANSFERRING = 2;
		public const int _COMPLETE = 3;
		public const int _ALTERNATIVE = 4;
		public const int _WAITOUT = 5;
		public const int _INSTALLED = 6;
		public const int _ONVEHICLE = 7;
		private int _value;
		private static int _size;
		private static CarrierState[] _array;
		public static string[] displayStrings;
		public static CarrierState[] displayValues;
		public static CarrierState NONE;
		public static CarrierState WAITIN;
		public static CarrierState TRANSFERRING;
		public static CarrierState COMPLETE;
		public static CarrierState ALTERNATIVE;
		public static CarrierState WAITOUT;
		public static CarrierState INSTALLED;
		public static CarrierState ONVEHICLE;
		public static CarrierState IT_ENUM_MAX;
		static CarrierState()
		{
			CarrierState._size = 8;
			CarrierState._array = new CarrierState[CarrierState._size];
			CarrierState.displayStrings = new string[CarrierState._size];
			CarrierState.displayValues = new CarrierState[CarrierState._size];
			CarrierState.NONE = new CarrierState(0);
			CarrierState.WAITIN = new CarrierState(1);
			CarrierState.TRANSFERRING = new CarrierState(2);
			CarrierState.COMPLETE = new CarrierState(3);
			CarrierState.ALTERNATIVE = new CarrierState(4);
			CarrierState.WAITOUT = new CarrierState(5);
			CarrierState.INSTALLED = new CarrierState(6);
			CarrierState.ONVEHICLE = new CarrierState(7);
			CarrierState.IT_ENUM_MAX = new CarrierState(2147483647);
			CarrierState.displayStrings[0] = "NONE";
			CarrierState.displayStrings[1] = "WAITIN";
			CarrierState.displayStrings[2] = "TRANSFERRING";
			CarrierState.displayStrings[3] = "COMPLETE";
			CarrierState.displayStrings[4] = "ALTERNATIVE";
			CarrierState.displayStrings[5] = "WAITOUT";
			CarrierState.displayStrings[6] = "INSTALLED";
			CarrierState.displayStrings[7] = "ONVEHICLE";
			CarrierState.displayValues[0] = CarrierState.NONE;
			CarrierState.displayValues[1] = CarrierState.WAITIN;
			CarrierState.displayValues[2] = CarrierState.TRANSFERRING;
			CarrierState.displayValues[3] = CarrierState.COMPLETE;
			CarrierState.displayValues[4] = CarrierState.ALTERNATIVE;
			CarrierState.displayValues[5] = CarrierState.WAITOUT;
			CarrierState.displayValues[6] = CarrierState.INSTALLED;
			CarrierState.displayValues[7] = CarrierState.ONVEHICLE;
		}
		public static string ValueToString(CarrierState val)
		{
			string result;
			switch (val.Value())
			{
			case 0:
				result = CarrierState.displayStrings[0];
				break;
			case 1:
				result = CarrierState.displayStrings[1];
				break;
			case 2:
				result = CarrierState.displayStrings[2];
				break;
			case 3:
				result = CarrierState.displayStrings[3];
				break;
			case 4:
				result = CarrierState.displayStrings[4];
				break;
			case 5:
				result = CarrierState.displayStrings[5];
				break;
			case 6:
				result = CarrierState.displayStrings[6];
				break;
			case 7:
				result = CarrierState.displayStrings[7];
				break;
			default:
				result = "";
				break;
			}
			return result;
		}
		public static CarrierState StringToValue(string val)
		{
			CarrierState result;
			if (Helper.IsNullOrEmpty(val))
			{
				result = CarrierState.IT_ENUM_MAX;
			}
			else
			{
				for (int i = 0; i < CarrierState.displayStrings.Length; i++)
				{
					if (val.Equals(CarrierState.displayStrings[i]))
					{
						result = CarrierState.displayValues[i];
						return result;
					}
				}
				result = null;
			}
			return result;
		}
		public int Value()
		{
			return this._value;
		}
		public static CarrierState From_Int(int value)
		{
			CarrierState result;
			if (value >= 1 && value < CarrierState._size)
			{
				result = CarrierState._array[value];
			}
			else
			{
				result = CarrierState.IT_ENUM_MAX;
			}
			return result;
		}
		protected CarrierState(int value)
		{
			this._value = value;
			if (value >= 1 && value < CarrierState._size)
			{
				CarrierState._array[this._value] = this;
			}
		}
		public bool Equals(CarrierState otherEnum)
		{
			return otherEnum.Value() == this._value;
		}
		public override string ToString()
		{
			return CarrierState.displayStrings[this._value];
		}
	}
}
